Skip to content

feat: Add helm template support for rbac and deployment naming#201

Merged
rowansmithau merged 2 commits into
mainfrom
rowan/helm_rbac_templating
Jun 19, 2026
Merged

feat: Add helm template support for rbac and deployment naming#201
rowansmithau merged 2 commits into
mainfrom
rowan/helm_rbac_templating

Conversation

@rowansmithau

Copy link
Copy Markdown
Member

adds support for custom naming of rbac name values, plus uses the helm release name for the deployment name.

this is primarily done in order to support multiple deployments of coder-logstream-kube in one kubernetes cluster, with each deployment specifying a distinct url value for distinct Coder deployments. In this setup both Coder deployments create Kubernetes based Coder workloads in the Kubernetes namespace.

Namespaced, with role + rolebinding:

coder@white-meadowlark-38:~/coder-logstream-kube$ helm template coder-logstream-kube-test \
helm -n clk --set namespaces[0]=coder-workloads \
--set rbac.roleName=dev-role \
--set rbac.roleBindingName=dev-role-binding \
| egrep -A2 'Deployment|kind: Role|kind: RoleBinding'
kind: Role
metadata:
  name: dev-role
--
kind: RoleBinding
metadata:
  name: dev-role-binding
--
  kind: Role
  name: dev-role
subjects:
--
kind: Deployment
metadata:
  name: coder-logstream-kube-test

Not namespaced, clusterrole + clusterrolebinding

coder@white-meadowlark-38:~/coder-logstream-kube$ helm template coder-logstream-kube-test \
helm -n clk \
--set rbac.roleName=dev-role \
--set rbac.roleBindingName=dev-role-binding \
| egrep -A2 'Deployment|kind: ClusterRole|kind: ClusterRoleBinding'
kind: ClusterRole
metadata:
  name: dev-role
--
kind: ClusterRoleBinding
metadata:
  name: dev-role-binding
--
  kind: ClusterRole
  name: dev-role
subjects:
--
kind: Deployment
metadata:
  name: coder-logstream-kube-test

@rowansmithau rowansmithau self-assigned this Jun 19, 2026
@rowansmithau rowansmithau added the enhancement New feature or request label Jun 19, 2026
@rowansmithau rowansmithau marked this pull request as ready for review June 19, 2026 03:18
Comment thread helm/values.yaml Outdated
Co-authored-by: Cian Johnston <public@cianjohnston.ie>
@rowansmithau rowansmithau requested a review from johnstcn June 19, 2026 08:16

@johnstcn johnstcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up: we don't have any helm tests for this repo that I can see. A simple helm template plus golden file would have caught the unintentional role name change.

@rowansmithau rowansmithau merged commit 500d0d5 into main Jun 19, 2026
6 of 8 checks passed
@rowansmithau rowansmithau deleted the rowan/helm_rbac_templating branch June 19, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants